FROM dart:stable AS build

WORKDIR /app

COPY /code /app

RUN dart pub get && dart compile exe bin/server.dart -o bin/server

FROM scratch

COPY --from=build /runtime/ /
COPY --from=build /app/bin/server /app/bin/
COPY --from=build /app/config/ /app/config/

WORKDIR /app

EXPOSE 8080

CMD ["/app/bin/server"]
